package {
	
	import flash.display.*;
	import flash.events.*;
	import flash.text.TextField;
	import flash.utils.Timer;
	import flash.geom.*;
	import flash.filters.*;
	//import gs.TweenMax;
	
	[SWF(backgroundColor="#aaaaaa", width="1000", height="600", frameRate="60")]
	
	public class pman_v1 extends Sprite {
		private var container:MovieClip = new MovieClip();
		//private var handler:NodeHandler = new NodeHandler(this);
		private var testRect:Shape = new Shape();
		private var field:TextField = new TextField();
		private var _node:WBSnode = new WBSnode();
		
		//private var object:Object_instansiator = new Object_instansiator();
		
		protected var _rWidth:Number = 250;
		protected var _rHeight:Number = 100;
		
		public var nodeWsum:Number;
		public var nodeSpace:Number;
		private var startingLocation:Point = new Point();
		private var il:Number;
		
		
		
		private var _timer:Timer;
				
		public function pman_v1() {
			//addChild(container);
			//handler.getNodes();
			
			/* il = 5;
			
			nodeWsum = stage.stageWidth/(il/_rWidth);
			nodeSpace = nodeWsum/(il+1); */
			
			//TweenMax.to(container, 1, {scaleX:.5, scaleY:.5});
			//myTween.setDestination("scaleX", addInputField.returnTextWidth);
			//_rWidth = addInputField.returnTextWidth;
			//testRect.graphics.beginFill( 0x000000 );
			//testRect.graphics.drawRoundRect( (stage.stageWidth -_rWidth)/2, (stage.stageHeight -_rHeight)/2, _rWidth, _rHeight, 10, 10 );
			//testRect.graphics.endFill();
			
			//addChild(testRect);
			
			
			_node.x = (stage.stageWidth - _node.width)/2;
			_node.y = _node.height;
			addChild(_node);
			var node2:WBSnode = new WBSnode("Carl");
			_node.addNode(node2);
			var node3:WBSnode = new WBSnode();
			_node.addNode(node3);
			var node4:WBSnode = new WBSnode();
			_node.addNode(node4);
			var node6:WBSnode = new WBSnode();
			var node7:WBSnode = new WBSnode();
			node6.addNode(node7);
			node4.addNode(node6);
			
			var node5:WBSnode = new WBSnode();
			_node.addNode(node5);
				
			
			
			//for (var i:int = 0; i < cars.length
			
			/* for(var x = 0; x < il; x++){
				var objIn = new Object_instansiator(result[x])
				objIn.name = "title" + x;
				target.addChild(objIn);
				//trace("result[i].id: " + result[x].id + " : " + result[x].title);				
			}; */
			//trace(object);
			
			/* _timer = new Timer(30);
			_timer.addEventListener("timer", onTimer);
			_timer.start(); */
		}
		
		/* private function addEventListeners():void{
			_red.addEventListener(MouseEvent.MOUSE_DOWN, pickup);
			_red.addEventListener(MouseEvent.MOUSE_UP, place);
			
			_timer.addEventListener("timer", onTimer);
		} */
		
		
		public function onTimer (e:TimerEvent):void {
			/* scaleXperc = addInputField.returnTextWidth; */
			/* TweenMax.to(container.testRect, .2, {scaleX:scaleXperc, scaleY:scaleYperc});
			myTween.setDestination("scaleX", scaleXperc);  */
		}
		
	}
}
